package com.etc.test3.staticproxy;

/**
 * @author MaZheng
 * @since 2020/12/23 - 14:50
 */
public class AProxy {

    private A target;

    public AProxy() {
    }

    public AProxy(A target) {
        this.target = target;
    }

    // 访问A类的方法要通过代理类去访问
    // 在方法执行之前和之后做处理
    public void a1() {

        try {
            System.out.println("之前处理");
            target.a1();
            System.out.println("之后处理");
        } catch (Exception e) {
            System.out.println("再要个运费错误处理");
        } finally {
            System.out.println("fianlly ");
        }
    }
}
